package com.twt.recruit.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.twt.recruit.entity.Time;
import com.twt.recruit.entity.TimeHand;
import com.twt.recruit.entity.vo.TimeSlot;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface TimeMapper extends BaseMapper<Time> {



    @Select("select application_id from time where project_id = #{projectId} and time_section = #{t}")
    List<Integer> getApplicationIdsByProjectId(Integer projectId, Integer t);

    @Select("select application_id, time_section from time where project_id = #{projectId} and application_id not in (select time_hand.application_id from time_hand where time_hand.project_id = #{projectId} and is_hand = 1)")
    List<TimeSlot> listTimeSlotsByProjectId(Integer projectId);

    @Delete("delete from time where project_id = #{projectId}")
    void delTimeProjectId(Integer projectId);
}
